package exception;

import common.enums.HttpCodeEnum;

/**
 * @Author: 郑国荣
 * @Date: 2024-02-22-14:28
 * @Description:
 */
public class ServiceException extends RuntimeException{
    private final HttpCodeEnum httpCodeEnum;

    private final String msg;

    public ServiceException() {
        this.httpCodeEnum = HttpCodeEnum.SERVER_ERROR;
        this.msg = HttpCodeEnum.SERVER_ERROR.getMsg();
    }

    public ServiceException(String msg) {
        this.httpCodeEnum = HttpCodeEnum.SERVER_ERROR;
        this.msg = msg;
    }

    public ServiceException(HttpCodeEnum httpCodeEnum) {
        this.httpCodeEnum = httpCodeEnum;
        this.msg = httpCodeEnum.getMsg();
    }

    public ServiceException(HttpCodeEnum httpCodeEnum, String msg) {
        this.httpCodeEnum = httpCodeEnum;
        this.msg = msg;
    }
}
